package dao

import (
	"gitee.com/Luna-CY/Golang-Project-Template/internal/context"
	"gitee.com/Luna-CY/Golang-Project-Template/internal/errors"
    "gitee.com/Luna-CY/Golang-Project-Template/model"
)

// BusinessExample Data access object for BusinessExample definition
type BusinessExample interface {
	Transactional
	
	// FindBusinessExampleByCondition find BusinessExample by simple condition from db
	FindBusinessExampleByCondition(ctx context.Context, page int, size int, options ...BusinessExampleOption) (int64, []*model.BusinessExample, errors.Error)
	
	// SaveBusinessExample save BusinessExample to db
	// if BusinessExample id is 0, it will create a new record, otherwise, it will update the record
	SaveBusinessExample(ctx context.Context, businessExample *model.BusinessExample) errors.Error

	// TakeBusinessExampleByCondition get BusinessExample by condition from db
	// if BusinessExample not found, return error type with errors.ErrorTypeRecordNotFound
	TakeBusinessExampleByCondition(ctx context.Context, options ...BusinessExampleOption) (*model.BusinessExample, errors.Error)

	// DeleteBusinessExampleByCondition delete BusinessExample by condition from db
	DeleteBusinessExampleByCondition(ctx context.Context, options ...BusinessExampleOption) errors.Error

	// BatchTakeBusinessExampleByCondition get BusinessExample by condition from db
	BatchTakeBusinessExampleByCondition(ctx context.Context, options ...BusinessExampleOption) ([]*model.BusinessExample, errors.Error)
}

